#pragma once
struct TVoxel;

#pragma pack(push)
#pragma pack(1)
struct THVA_Main_Header {
    uint8_t FilePath[16];  // ASCIIZ string
    uint32_t N_Frames;     // Number of animation frames
    uint32_t N_Sections;   // Number of voxel sections described
};
struct THVAData {
    uint8_t SectionName[16];
};

struct TTransformMatrix {
    float transform[3][4];
};

struct THVA {
    THVA_Main_Header header;
    THVAData *Data;
    TTransformMatrix *TransformMatrices;
    TVoxel *p_Voxel;

    bool read;
    THVA():Data(NULL),TransformMatrices(NULL),p_Voxel(NULL),read(false){};
    ~THVA(){
        if(Data) delete[] Data;
        if(TransformMatrices) delete[] TransformMatrices;
    }
};
#pragma pack(pop)

class CHva
{
public:
    CHva(void);
    ~CHva(void);

    THVA* Get(CString filename, TVoxel *pVxl);

private:
    map<CString, THVA*> m_mapHvas;
};

